/**
 * futures : masterlink.futures.vo.VolatilityComm.java
 */
package masterlink.futures.vo;

import java.io.Serializable;
import java.sql.Date;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * TODO Write the description
 *
 * @author : tonyyang
 * Create date : 2011/11/25
 * @version 1.0.0	
 */
@Entity
@Table(name="VolatilityComm")
public class VolatilityComm  implements Serializable{

	private static final long serialVersionUID = -1335980828759175809L;
	@EmbeddedId
	private PK id;
	@Column(name="weight")
	private Double weight;
	@Column(name="futWeight")
	private Double futWeight;
	@Column(name="w21")
	private Double w21;
	@Column(name="w63")
	private Double w63;
	@Column(name="w126")
	private Double w126;
	@Column(name="w252")
	private Double w252;
	@Column(name="f21")
	private Double f21;
	@Column(name="f63")
	private Double f63;
	@Column(name="f126")
	private Double f126;
	@Column(name="f252")
	private Double f252;
	@Column(name="ivc")
	private Double ivc;
	@Column(name="ivp")
	private Double ivp;
	@Column(name="ivcp")
	private Double ivcp;
	
	/**
	 * @return the id
	 */
	public PK getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(PK id) {
		this.id = id;
	}

	/**
	 * @return the weight
	 */
	public Double getWeight() {
		return weight;
	}

	/**
	 * @param weight the weight to set
	 */
	public void setWeight(Double weight) {
		this.weight = weight;
	}

	/**
	 * @return the futWeight
	 */
	public Double getFutWeight() {
		return futWeight;
	}

	/**
	 * @param futWeight the futWeight to set
	 */
	public void setFutWeight(Double futWeight) {
		this.futWeight = futWeight;
	}

	/**
	 * @return the w21
	 */
	public Double getW21() {
		return w21;
	}

	/**
	 * @param w21 the w21 to set
	 */
	public void setW21(Double w21) {
		this.w21 = w21;
	}

	/**
	 * @return the w63
	 */
	public Double getW63() {
		return w63;
	}

	/**
	 * @param w63 the w63 to set
	 */
	public void setW63(Double w63) {
		this.w63 = w63;
	}

	/**
	 * @return the w126
	 */
	public Double getW126() {
		return w126;
	}

	/**
	 * @param w126 the w126 to set
	 */
	public void setW126(Double w126) {
		this.w126 = w126;
	}

	/**
	 * @return the w256
	 */
	public Double getW252() {
		return w252;
	}

	/**
	 * @param w256 the w256 to set
	 */
	public void setW256(Double w252) {
		this.w252 = w252;
	}

	/**
	 * @return the f21
	 */
	public Double getF21() {
		return f21;
	}

	/**
	 * @param f21 the f21 to set
	 */
	public void setF21(Double f21) {
		this.f21 = f21;
	}

	/**
	 * @return the f63
	 */
	public Double getF63() {
		return f63;
	}

	/**
	 * @param f63 the f63 to set
	 */
	public void setF63(Double f63) {
		this.f63 = f63;
	}

	/**
	 * @return the f126
	 */
	public Double getF126() {
		return f126;
	}

	/**
	 * @param f126 the f126 to set
	 */
	public void setF126(Double f126) {
		this.f126 = f126;
	}

	/**
	 * @return the f256
	 */
	public Double getF252() {
		return f252;
	}

	/**
	 * @param f256 the f256 to set
	 */
	public void setF256(Double f252) {
		this.f252 = f252;
	}

	/**
	 * @return the ivc
	 */
	public Double getIvc() {
		return ivc;
	}

	/**
	 * @param ivc the ivc to set
	 */
	public void setIvc(Double ivc) {
		this.ivc = ivc;
	}

	/**
	 * @return the ivp
	 */
	public Double getIvp() {
		return ivp;
	}

	/**
	 * @param ivp the ivp to set
	 */
	public void setIvp(Double ivp) {
		this.ivp = ivp;
	}

	/**
	 * @return the ivcp
	 */
	public Double getIvcp() {
		return ivcp;
	}

	/**
	 * @param ivcp the ivcp to set
	 */
	public void setIvcp(Double ivcp) {
		this.ivcp = ivcp;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (!(obj instanceof VolatilityComm))
			return false;
		VolatilityComm other = (VolatilityComm) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("VolatilityComm [id=");
		builder.append(id);
		builder.append(", weight=");
		builder.append(weight);
		builder.append(", futWeight=");
		builder.append(futWeight);
		builder.append(", w21=");
		builder.append(w21);
		builder.append(", w63=");
		builder.append(w63);
		builder.append(", w126=");
		builder.append(w126);
		builder.append(", w252=");
		builder.append(w252);
		builder.append(", f21=");
		builder.append(f21);
		builder.append(", f63=");
		builder.append(f63);
		builder.append(", f126=");
		builder.append(f126);
		builder.append(", f252=");
		builder.append(f252);
		builder.append(", ivc=");
		builder.append(ivc);
		builder.append(", ivp=");
		builder.append(ivp);
		builder.append(", ivcp=");
		builder.append(ivcp);
		builder.append("]");
		return builder.toString();
	}

	@Embeddable
	public static class PK implements Serializable{

		private static final long serialVersionUID = 8602964234040365103L;
		@Column(name="date1")
		private Date date1;
		@Column(name="comm")
		private String comm;
		/**
		 * @return the date1
		 */
		public Date getDate1() {
			return date1;
		}
		/**
		 * @param date1 the date1 to set
		 */
		public void setDate1(Date date1) {
			this.date1 = date1;
		}
		/**
		 * @return the comm
		 */
		public String getComm() {
			return comm;
		}
		/**
		 * @param comm the comm to set
		 */
		public void setComm(String comm) {
			this.comm = comm;
		}
		/* (non-Javadoc)
		 * @see java.lang.Object#toString()
		 */
		@Override
		public String toString() {
			StringBuilder builder = new StringBuilder();
			builder.append("PK [date1=");
			builder.append(date1);
			builder.append(", comm=");
			builder.append(comm);
			builder.append("]");
			return builder.toString();
		}
		/* (non-Javadoc)
		 * @see java.lang.Object#hashCode()
		 */
		@Override
		public int hashCode() {
			final int prime = 31;
			int result = 1;
			result = prime * result + ((comm == null) ? 0 : comm.hashCode());
			result = prime * result + ((date1 == null) ? 0 : date1.hashCode());
			return result;
		}
		/* (non-Javadoc)
		 * @see java.lang.Object#equals(java.lang.Object)
		 */
		@Override
		public boolean equals(Object obj) {
			if (this == obj)
				return true;
			if (obj == null)
				return false;
			if (!(obj instanceof PK))
				return false;
			PK other = (PK) obj;
			if (comm == null) {
				if (other.comm != null)
					return false;
			} else if (!comm.equals(other.comm))
				return false;
			if (date1 == null) {
				if (other.date1 != null)
					return false;
			} else if (!date1.equals(other.date1))
				return false;
			return true;
		}
		
	}
	
}
